Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 2fa #213

Merged
merged 15 commits into from
Feb 23, 2024
Merged

Feature 2fa #213

merged 15 commits into from
Feb 23, 2024

Conversation

PhamAnhHoang
Copy link
Collaborator

What does it do?

Describe the technical changes you did.

Why is it needed?

Describe the issue you are solving.

How to test it?

Provide information about the environment and the path to verify the behaviour.

Related issue(s)/PR(s)

Let us know if this is related to any issue/pull request

Copy link

vercel bot commented Feb 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
isomera-compodoc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 23, 2024 10:48am
isomera-platform ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 23, 2024 10:48am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
isomera-landing ⬜️ Ignored (Inspect) Visit Preview Feb 23, 2024 10:48am

@PhamAnhHoang PhamAnhHoang changed the title Feature/2 fa Feature 2fa Feb 6, 2024
@PhamAnhHoang PhamAnhHoang linked an issue Feb 7, 2024 that may be closed by this pull request
Closed
})

interface Options {
onSuccess?: (response: any) => void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's a good place for DTO?

Copy link
Contributor

@vygandas vygandas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, missing recovery codes which should have been displayed when 2fa was confirmed.
When trying to login, get error:

[Nest] 74169  - 02/10/2024, 4:08:17 PM   ERROR [ExceptionsHandler] The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received null
TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received null
    at new NodeError (node:internal/errors:405:5)
    at Function.from (node:buffer:333:9)
    at new Buffer (node:buffer:288:17)
    at Object.exports.decode (/Users/vygandas/git/isomera/node_modules/thirty-two/lib/thirty-two/thirty-two.js:87:16)
    at Object.keyDecoder (/Users/vygandas/git/isomera/node_modules/@otplib/plugin-thirty-two/index.js:17:20)
    at authenticatorDecoder (/Users/vygandas/git/isomera/node_modules/@otplib/core/index.js:413:18)
    at authenticatorCheckWithWindow (/Users/vygandas/git/isomera/node_modules/@otplib/core/index.js:423:37)
    at Authenticator.checkDelta (/Users/vygandas/git/isomera/node_modules/@otplib/core/index.js:436:12)
    at Authenticator.check (/Users/vygandas/git/isomera/node_modules/@otplib/core/index.js:358:24)
    at Authenticator.verify (/Users/vygandas/git/isomera/node_modules/@otplib/core/index.js:365:17)

Missing .env maybe or just a bug?

@@ -102,9 +105,15 @@ export class AuthController {
@Post('/refresh')
@HttpCode(HttpStatus.OK)
async refreshToken(
@AuthUser() user: Pure<UserEntity>
@AuthUser() user: Pure<UserEntity> & { isTwoFactorAuthenticated: boolean }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this prop already be in UserEntity?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field doesn't exist in the entity because it's not being stored in the db

apps/api/src/auth/auth.service.ts Outdated Show resolved Hide resolved
apps/api/src/auth/auth.service.ts Outdated Show resolved Hide resolved
apps/api/src/auth/auth.service.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2FA
2 participants